package com.yequan.thread.threadpool.prioritythreadpool;


/**
 * @author yq
 * @date 2020/06/05
 */
public abstract class PriorityTask implements Runnable, Comparable<PriorityTask> {

    private Integer priority;


    public PriorityTask(Integer priority) {
        this.priority = priority;
    }

    @Override
    public abstract void run();


    @Override
    public int compareTo(PriorityTask o) {
        return priority.compareTo(o.priority);
    }
}